package com.alks.function.controller.chengKong;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.WebLogger;
import com.alks.entity.data.entity.YfColorDetail;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.request.chengKong.ColorSystemRequest;
import com.alks.function.data.request.chengKong.MonochromeRequest;
import com.alks.function.data.request.chengKong.MonochromeRequest2;
import com.alks.function.data.request.chengKong.PolychromeRequest;
import com.alks.function.service.chengKong.ColorAttributeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@ApiRestController("/ColorAttribute")
@Slf4j
@Api(tags = {"成控部-物料管理作业-颜色属性定义"
        ,"成控部-物料管理作业-贴合材料建档"})
public class ColorAttributeController {

    @Autowired
    private ColorAttributeService colorAttributeService;

    @WebLogger
    @PostMapping("/getMonochromeList")
    @ApiOperation(value = "单色系明细",tags = "成控部-物料管理作业-颜色属性定义")
    public ResponseInfo getMonochromeList(@RequestBody MonochromeRequest request){
        return colorAttributeService.getMonochromeList(request);
    }

    @WebLogger
    @PostMapping("/getMonochromeAdd")
    @ApiOperation(value = "单色系添加",tags = "成控部-物料管理作业-颜色属性定义")
    public ResponseInfo getMonochromeAdd(@RequestBody YfColorDetail yfColorDetail){
        return colorAttributeService.getMonochromeAdd(yfColorDetail);
    }

    @WebLogger
    @PutMapping("/getMonochromeUpdate")
    @ApiOperation(value = "色系修改",tags = "成控部-物料管理作业-颜色属性定义")
    public ResponseInfo getMonochromeUpdate(@RequestBody YfColorDetail yfColorDetail){
        return colorAttributeService.getMonochromeUpdate(yfColorDetail);
    }

    @WebLogger
    @PostMapping("/getMonochromeDel")
    @ApiOperation(value = "色系删除",tags = "成控部-物料管理作业-颜色属性定义")
    public ResponseInfo getMonochromeDel(@RequestBody MonochromeRequest2 request){
        return colorAttributeService.getMonochromeDel(request);
    }

    @WebLogger
    @PostMapping("/getPolychromeList")
    @ApiOperation(value = "插色系明细",tags = "成控部-物料管理作业-颜色属性定义")
    public ResponseInfo getPolychromeList(@RequestBody PolychromeRequest request){
        return colorAttributeService.getPolychromeList(request);
    }

    @WebLogger
    @PostMapping("/getPolychromeAdd")
    @ApiOperation(value = "插色系添加",tags = "成控部-物料管理作业-颜色属性定义")
    public ResponseInfo getPolychromeAdd(@RequestBody YfColorDetail yfColorDetail){
        return colorAttributeService.getPolychromeAdd(yfColorDetail);
    }

    @WebLogger
    @PostMapping("/getColorSystemList")
    @ApiOperation(value = "选择颜色",tags = "成控部-物料管理作业-贴合材料建档")
    public ResponseInfo getColorSystemList(@RequestBody ColorSystemRequest request){
        return colorAttributeService.getColorSystemList(request);
    }

    @WebLogger
    @GetMapping("/getYfColorDetail")
    @ApiOperation(value = "判断颜色是否存在",tags = "成控部-物料管理作业-贴合材料建档")
    public ResponseInfo getYfColorDetail(@RequestParam String color){
        return colorAttributeService.getYfColorDetail(color);
    }

}
